home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / text / misc / MSWordView_src.lha / mswordview / sprm.c < prev    next >
C/C++ Source or Header  |  1998-12-15  |  19KB  |  779 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5. #include "config.h"
  6. #include "mswordview.h"
  7.  
  8. extern FILE *erroroutput;
  9.  
  10. extern U16 colorlookupr[17];
  11. extern U16 colorlookupg[17];
  12. extern U16 colorlookupb[17];
  13.  
  14. void decode_sprm(FILE* in,U16 clist,pap *retpap,chp *retchp,sep *retsep,U16 *l,U8 **list,style *sheet,U16 istd)
  15.     {
  16.     int i;
  17.     int sprmlen;
  18.     U16 sprm2;
  19.     U8 len;
  20.     U8 flags;
  21.     U16 j;
  22.     int orig;
  23.     chp emchp;
  24.     S16 temp;
  25.     U16 temp2;
  26.     U16 temp3;
  27.     U16 temp4;
  28.     chp modifiedchp;
  29.     chp blank_chp;
  30.     
  31.  
  32.     error(erroroutput,"SPRM is %x\n",(int)clist);
  33.  
  34.     switch(clist)
  35.         {
  36.         /*sep*/
  37.         case 0x3009:
  38.             retsep->bkc=dgetc(in,list);
  39.             (*l)++;
  40.             break;
  41.         case 0x300A:
  42.             retsep->fTitlePage=dgetc(in,list);
  43.             (*l)++;
  44.             break;
  45.         case 0x300E:
  46.             retsep->nfcPgn=dgetc(in,list);
  47.             error(erroroutput,"nfcPgn is %d\n",retsep->nfcPgn);
  48.             (*l)++;
  49.             break;
  50.         case 0x3011:
  51.             retsep->restart=dgetc(in,list);
  52.             (*l)++;
  53.             break;
  54.         case 0x3012:
  55.             retsep->fEndNote=dgetc(in,list);
  56.             (*l)++;
  57.             break;
  58.         case 0x3013:
  59.             retsep->lnc=dgetc(in,list);
  60.             (*l)++;
  61.             break;
  62.         case 0x500B:
  63.             retsep->ccolM1=dread_16ubit(in,list);
  64.             (*l)+=2;
  65.             break;
  66.         case 0x5015:
  67.             retsep->nLnnMod=dgetc(in,list);
  68.             (*l)++;
  69.             break;
  70.         case 0x501C:
  71.             retsep->pgnStart=dread_16ubit(in,list);
  72.             (*l)+=2;
  73.             break;
  74.         /*pap*/
  75.         case 0xC63E:
  76.             error(erroroutput,"anld here\n");
  77.             len = dgetc(in,list);
  78.             (*l)++;
  79.             retpap->anld.nfc = dgetc(in,list);
  80.             retpap->anld.cxchTextBefore = dgetc(in,list);
  81.             retpap->anld.cxchTextAfter= dgetc(in,list);
  82.             flags=dgetc(in,list);
  83.             retpap->anld.jc = flags&0x03;
  84.             retpap->anld.fPrev = flags&0x04;
  85.             retpap->anld.fHang = flags&0x08;
  86.             retpap->anld.fSetBold = flags&0x10;
  87.             retpap->anld.fSetItalic = flags&0x20;
  88.             retpap->anld.fSetSmallCaps = flags&0x40;
  89.             retpap->anld.fSetCaps = flags&0x80;
  90.             retpap->anld.flags2=dgetc(in,list);
  91.             retpap->anld.flags3=dgetc(in,list);
  92.             retpap->anld.ftc=dread_16ubit(in,list);
  93.             retpap->anld.hps=dread_16ubit(in,list);
  94.             retpap->anld.startat=dread_16ubit(in,list);
  95.             dread_16ubit(in,list);
  96.             dread_16ubit(in,list);
  97.             dread_16ubit(in,list);
  98.             dread_16ubit(in,list);
  99.             for (i=0;i<32;i++)
  100.                 retpap->anld.rgxch[i] = dread_16ubit(in,list);
  101.             (*l)+=84;
  102.             break;
  103.         case 0x2602:
  104.         case 0x2640:
  105.             error(erroroutput,"aha lvl!!!\n");
  106.             dgetc(in,list);
  107.             (*l)++;
  108.             break;
  109.         case 0xC615:
  110.         case 0xC60D:
  111.             error(erroroutput,"TABTABTAB\n");
  112.             len = dgetc(in,list);
  113.             error(erroroutput,"len is %d\n",len);
  114.             (*l)++;
  115.             for (i=0;i<len;i++)
  116.                 {
  117.                 dgetc(in,list);
  118.                 (*l)++;
  119.                 }
  120.             break;
  121.         case 0x2416:
  122.             retpap->fInTable = dgetc(in,list);
  123.             error(erroroutput,"FIntable set to %d\n",retpap->fInTable);
  124.             (*l)++;
  125.             break;
  126.         case 0x2417:
  127.             retpap->fInTable = 1;
  128.             retpap->fTtp = dgetc(in,list);
  129.             error(erroroutput,"FIntable set to %d indirectly\n",retpap->fInTable);
  130.             (*l)++;
  131.             break;
  132.         case 0x260A:
  133.             retpap->ilvl = dgetc(in,list);
  134.             error(erroroutput,"ilvl set to %d\n",retpap->ilvl);
  135.             if (retpap->ilvl > 8)
  136.                 {
  137.                 error(erroroutput,"hmm, strange ilvl here, setting to -1\n");
  138.                 retpap->ilvl =-1;
  139.                 }
  140.             (*l)++;
  141.             break;
  142.         case 0x460B:
  143.             retpap->ilfo = dread_16ubit(in,list);
  144.             /*
  145.             like Collin Park (collin@hpycla.kobe.hp.com) says
  146.             i probably have to back through loads of code and 
  147.             check for sign extensions and friends, oh oh
  148.             */
  149.             error(erroroutput,"ilfo is %d\n",retpap->ilfo);
  150.             if (retpap->ilfo == 2047)
  151.                 error(erroroutput,"warning, special list depth\n");
  152.             else
  153.                 {
  154.                 if (retpap->ilfo == 0)
  155.                     error(erroroutput,"not numbered (bulleted ?)\n");
  156.                 retpap->ilfo--;
  157.                 }
  158.             error(erroroutput,"ilfo is now %d\n",retpap->ilfo);
  159.             (*l)+=2;
  160.             break;
  161.         case 0x4600:
  162.             retpap->istd = dread_16ubit(in,list);
  163.             error(erroroutput,"MAGIC: istd is %d\n",retpap->istd);
  164.             (*l)+=2;
  165.             break;
  166.  
  167.         /*chp*/
  168.         case 0x802:
  169.             orig = retchp->fData;
  170.             retchp->fData= dgetc(in,list);
  171.             (*l)++;
  172.             switch (retchp->fData)
  173.                 {
  174.                 case 1:
  175.                     retchp->fData= 1;
  176.                     break;
  177.                 case 0:
  178.                     retchp->fData= 0;
  179.                     break;
  180.                 case 128:
  181.                     /*in this case bold value is the based upon val*/
  182.                     retchp->fData= orig;
  183.                     break;
  184.                 case 129:
  185.                     error(erroroutput,"swapping around\n");
  186.                     retchp->fData= abs(orig-1);
  187.                     break;
  188.                 }
  189.             error(erroroutput,"fData is now %d\n",retchp->fData);
  190.             (*l)++;
  191.             break;
  192.         case 0x2A32:
  193.             retchp->fBold=0;
  194.             retchp->fItalic=0;
  195.             retchp->fCaps=0;
  196.             retchp->fSmallCaps=0;
  197.             retchp->underline=0;
  198.             retchp->fStrike=0;
  199.             retchp->color[0] = '\0';
  200.             dgetc(in,list);
  201.             (*l)++;
  202.             break;
  203.         case 0x2A33:
  204.             temp = retchp->fSpec;
  205.             init_chp_from_istd(retchp->istd,sheet,retchp); /*i think this is right, not tested*/
  206.             retchp->fSpec = temp;
  207.             break;
  208.         case 0x2859:
  209.             retchp->animation = dgetc(in,list);
  210.             (*l)++;
  211.             break;
  212.         case 0x286F:
  213.             retchp->idctHint = dgetc(in,list);
  214.             error(erroroutput,"hint is %d\n",retchp->idctHint);
  215.             (*l)++;
  216.             break;
  217.         case 0xCA47:
  218.         case 0xCA4A:
  219.             /*
  220.             take the embedded chp, compare to external chp
  221.             the equal fields are set to the styles ones
  222.             */
  223.             sprmlen=dgetc(in,list);
  224.             (*l)++;
  225.             error(erroroutput," the len is %d\n",sprmlen);
  226.             j=0;
  227.             init_chp(&emchp);
  228.             while(j<sprmlen)
  229.                 {
  230.                 sprm2 = dread_16ubit(in,list);
  231.                 j+=2;
  232.                 error(erroroutput,"embedded sprm is %X\n",sprm2);
  233.                 /*
  234.                 decode_sprm(in,sprm2,retpap,&emchp,&j,list,sheet,retpap->istd);
  235.                 */
  236.                 decode_sprm(in,sprm2,retpap,&emchp,retsep,&j,list,sheet,istd);
  237.                 error(erroroutput,"em j got set to %d\n",j);
  238.                 }
  239.             error(erroroutput,"retpap->istd is %d\n",retpap->istd);
  240.             retpap->istd = 10; /*surely blatent rubbish ?, this does do the right thing, ive misread
  241.             something somewhere, and im not seeing the obvious*/
  242.  
  243.             *l = *l + j;
  244. #if 0
  245.             if (emchp.fBold == retchp->fBold)
  246.                 retchp->fBold = sheet[retpap->istd].thechp.fBold;
  247.             if (emchp.fItalic== retchp->fItalic)
  248.                 retchp->fItalic= sheet[retpap->istd].thechp.fItalic;
  249.             if (emchp.fontsize== retchp->fontsize)
  250.                 retchp->fontsize= sheet[retpap->istd].thechp.fontsize;
  251.             if (emchp.underline== retchp->underline)
  252.                 retchp->underline= sheet[retpap->istd].thechp.underline;
  253. #endif
  254.             if (emchp.fBold == retchp->fBold)
  255.                 retchp->fBold = sheet[istd].thechp.fBold;
  256.             if (emchp.fItalic== retchp->fItalic)
  257.                 retchp->fItalic= sheet[istd].thechp.fItalic;
  258.             if (emchp.fontsize== retchp->fontsize)
  259.                 retchp->fontsize= sheet[istd].thechp.fontsize;
  260.             if (emchp.underline== retchp->underline)
  261.                 retchp->underline= sheet[istd].thechp.underline;
  262.             if (emchp.fStrike== retchp->fStrike)
  263.                 retchp->fStrike= sheet[istd].thechp.fStrike;
  264.             /*others not implemented yet*/
  265.             break;
  266.         case 0x486D:
  267.         case 0x486E:
  268.             error(erroroutput,"lid data is %X",dread_16ubit(in,list));
  269.             (*l)+=2;
  270.             break;
  271.         case 0x0835:
  272.             orig = retchp->fBold;
  273.             retchp->fBold= dgetc(in,list);
  274.             (*l)++;
  275.             switch (retchp->fBold)
  276.                 {
  277.                 case 1:
  278.                     retchp->fBold= 1;
  279.                     break;
  280.                 case 0:
  281.                     retchp->fBold= 0;
  282.                     break;
  283.                 case 128:
  284.                     /*in this case bold value is the based upon val*/
  285.                     retchp->fBold = orig;
  286.                     break;
  287.                 case 129:
  288.                     error(erroroutput,"swapping around\n");
  289.                     retchp->fBold = abs(orig-1);
  290.                     break;
  291.                 }
  292.             error(erroroutput,"BOLD is %d\n",retchp->fBold);
  293.             /*not sure what each 0,127 etc mean yet*/
  294.             error(erroroutput,"j here is %d\n",*l);
  295.             break;
  296.         case 0x083A:
  297.             orig = retchp->fSmallCaps;
  298.             retchp->fSmallCaps= dgetc(in,list);
  299.             (*l)++;
  300.             error(erroroutput,"SMALLCAPS is %d\n",retchp->fSmallCaps);
  301.             switch(retchp->fSmallCaps)
  302.                 {
  303.                 case 1:
  304.                     retchp->fSmallCaps= 1;
  305.                     break;
  306.                 case 0:
  307.                     retchp->fSmallCaps= 0;
  308.                     break;
  309.                 case 128:
  310.                     /*set to original*/
  311.                     retchp->fSmallCaps= orig;
  312.                     break;
  313.                 case 129:
  314.                     retchp->fSmallCaps= abs(orig-1);
  315.                     break;
  316.                 }
  317.             break;
  318.         case 0x083B:
  319.             orig = retchp->fCaps;
  320.             retchp->fCaps= dgetc(in,list);
  321.             (*l)++;
  322.             error(erroroutput,"CAPS is %d\n",retchp->fCaps);
  323.             switch(retchp->fCaps)
  324.                 {
  325.                 case 1:
  326.                     retchp->fCaps= 1;
  327.                     break;
  328.                 case 0:
  329.                     retchp->fCaps= 0;
  330.                     break;
  331.                 case 128:
  332.                     /*set to original*/
  333.                     retchp->fCaps= orig;
  334.                     break;
  335.                 case 129:
  336.                     retchp->fCaps= abs(orig-1);
  337.                     break;
  338.                 }
  339.             break;
  340.         case 0x0836:
  341.             orig = retchp->fItalic;
  342.             retchp->fItalic = dgetc(in,list);
  343.             (*l)++;
  344.             error(erroroutput,"ITALIC is %d\n",retchp->fItalic);
  345.             switch(retchp->fItalic)
  346.                 {
  347.                 case 1:
  348.                     retchp->fItalic = 1;
  349.                     break;
  350.                 case 0:
  351.                     retchp->fItalic = 0;
  352.                     break;
  353.                 case 128:
  354.                     /*set to original*/
  355.                     retchp->fItalic = orig;
  356.                     break;
  357.                 case 129:
  358.                     retchp->fItalic = abs(orig-1);
  359.                     break;
  360.                 }
  361.             break;
  362.         case 0x2A53:
  363.             orig = retchp->fDStrike;
  364.             retchp->fDStrike= dgetc(in,list);
  365.             (*l)++;
  366.             error(erroroutput,"STRIKE is %d\n",retchp->fDStrike);
  367.             switch(retchp->fDStrike)
  368.                 {
  369.                 case 1:
  370.                     retchp->fDStrike= 1;
  371.                     break;
  372.                 case 0:
  373.                     retchp->fDStrike= 0;
  374.                     break;
  375.                 case 128:
  376.                     /*set to original*/
  377.                     retchp->fDStrike= orig;
  378.                     break;
  379.                 case 129:
  380.                     retchp->fDStrike= abs(orig-1);
  381.                     break;
  382.                 }
  383.             break;
  384.         case 0x0837:
  385.             orig = retchp->fStrike;
  386.             retchp->fStrike= dgetc(in,list);
  387.             (*l)++;
  388.             error(erroroutput,"STRIKE is %d\n",retchp->fStrike);
  389.             switch(retchp->fStrike)
  390.                 {
  391.                 case 1:
  392.                     retchp->fStrike= 1;
  393.                     break;
  394.                 case 0:
  395.                     retchp->fStrike= 0;
  396.                     break;
  397.                 case 128:
  398.                     /*set to original*/
  399.                     retchp->fStrike= orig;
  400.                     break;
  401.                 case 129:
  402.                     retchp->fStrike= abs(orig-1);
  403.                     break;
  404.                 }
  405.             break;
  406.         case 0x841A:
  407.             retpap->dxaWidth=dread_16ubit(in,list);
  408.             (*l)+=2;
  409.             break;
  410.         case 0x6426:
  411.             /*
  412.             dread_16ubit(in,list);
  413.             dgetc(in,list);
  414.             len = dgetc(in,list);
  415.             len = len&0x1f;
  416.             */
  417.             retpap->brcBottom=dread_32ubit(in,list);
  418.             error(erroroutput,"border depth is %d\n",(retpap->brcBottom>>24)&0x1f);
  419.             (*l)+=4;
  420.             break;
  421.         case 0x6425:
  422.             retpap->brcLeft=dread_32ubit(in,list);
  423.             error(erroroutput,"border depth is %d\n",(retpap->brcLeft>>24)&0x1f);
  424.             (*l)+=4;
  425.             break;
  426.         case 0x6427:
  427.             retpap->brcRight=dread_32ubit(in,list);
  428.             error(erroroutput,"border depth is %d\n",(retpap->brcRight>>24)&0x1f);
  429.             (*l)+=4;
  430.             break;
  431.         case 0x6428:
  432.             retpap->brcBetween=dread_32ubit(in,list);
  433.             error(erroroutput,"border depth is %d\n",(retpap->brcBetween>>24)&0x1f);
  434.             (*l)+=4;
  435.             break;
  436.         case 0x6424:
  437.         case 0x6429:
  438.             dread_16ubit(in,list);
  439.             dread_16ubit(in,list);
  440.             (*l)+=4;
  441.             break;
  442.         case 0x0800:
  443.         case 0x0838:
  444.         case 0x0839:
  445.         case 0x083C:
  446.         case 0x2407:
  447.         case 0x2431:
  448.             dgetc(in,list);
  449.             (*l)++;
  450.             break;
  451.         case 0x4845:
  452.             /*how much to sub and super*/
  453.             dread_16ubit(in,list);
  454.             (*l)+=2;
  455.             break;
  456.         case 0x4A43:
  457.             retchp->fontsize = dread_16ubit(in,list);
  458.             (*l)+=2;
  459.             error(erroroutput,"font is %d\n",retchp->fontsize);
  460.             break;
  461.         case 0x4A30:
  462.             retchp->istd = dread_16ubit(in,list);
  463.             error(erroroutput,"aha wants to set char istd to %ld ?\n",retchp->istd);
  464.             /*does this mean that i set everything back based on that istd ?, im guessing so*/
  465.             /*
  466.             *retchp = sheet[sprm3].thechp;
  467.             */
  468.             modifiedchp = *retchp; /*bitwisecopy will work fine*/
  469.             init_chp(&blank_chp);
  470.             init_chp_from_istd(retchp->istd,sheet,retchp);
  471.             
  472.             merge_chps(&blank_chp,&modifiedchp,retchp);
  473.             
  474.             (*l)+=2;
  475.             break;
  476.         case 0x261B:
  477.             dgetc(in,list);
  478.             (*l)++;
  479.             break;
  480.         case 0x4A4F:
  481.             retchp->ascii_font=dread_16ubit(in,list);
  482.             error(erroroutput,"font stuff for ascii text is %ld\n",retchp->ascii_font);
  483.             (*l)+=2;
  484.             break;
  485.         case 0x4A50:
  486.             retchp->eastfont=dread_16ubit(in,list);
  487.             error(erroroutput,"font stuff for east text is %ld\n",retchp->eastfont);
  488.             (*l)+=2;
  489.             break;
  490.         case 0x4A51:
  491.             retchp->noneastfont=dread_16ubit(in,list);
  492.             error(erroroutput,"font stuff for noneast text is %ld\n",retchp->noneastfont);
  493.             (*l)+=2;
  494.             break;
  495.         case 0xA413:
  496.             retpap->dyaBefore=dread_16ubit(in,list);
  497.             error(erroroutput,"before is %d\n",retpap->dyaBefore);
  498.             (*l)+=2;
  499.             break;
  500.         case 0xA414:
  501.             retpap->dyaAfter=dread_16ubit(in,list);
  502.             error(erroroutput,"after is %d\n",retpap->dyaAfter);
  503.             (*l)+=2;
  504.             break;
  505.         case 0x486B:
  506.         case 0x0418:
  507.         case 0x484B:
  508.         case 0x484E:
  509.             error(erroroutput,"eat\n");
  510.             dread_16ubit(in,list);
  511.             (*l)+=2;
  512.             break;
  513.         case 0xB021:
  514.             retsep->leftmargin = (S16)dread_16ubit(in,list);
  515.             error(erroroutput,"this sections indent is %d\n",retsep->leftmargin);
  516.             (*l)+=2;
  517.             break;
  518.         case 0x840F:
  519.             retpap->leftmargin=(S16)dread_16ubit(in,list);
  520.             error(erroroutput,"left indent is %d\n",retpap->leftmargin);
  521.             (*l)+=2;
  522.             break;
  523.         case 0x840E:
  524.             retpap->rightmargin=(S16)dread_16ubit(in,list);
  525.             error(erroroutput,"right indent is %d\n",retpap->rightmargin);
  526.             (*l)+=2;
  527.             break;
  528.         case 0x4610:
  529.             temp = (S16)dread_16ubit(in,list);
  530.             error(erroroutput,"nest left indent is %d\n",temp);
  531.             if (temp < 0)
  532.                 retpap->leftmargin=0;
  533.             else
  534.                 retpap->leftmargin+=temp;
  535.             (*l)+=2;
  536.             break;
  537.         case 0x8411:
  538.             retpap->firstline = (S16)dread_16ubit(in,list);
  539.             error(erroroutput,"first line left1 indent is %d\n",retpap->firstline);
  540.             (*l)+=2;
  541.             break;
  542.         case 0x9407:
  543.             retpap->ourtap.rowheight = (S16)dread_16ubit(in,list);
  544.             error(erroroutput,"the height of the table is %d\n",retpap->ourtap.rowheight);
  545.             (*l)+=2;
  546.             break;
  547.         case 0x9602:
  548.             error(erroroutput,"9602: gives %d\n",dread_16ubit(in,list));
  549.             (*l)+=2;
  550.             break;
  551.         case 0x2A42:
  552.             temp2 = dgetc(in,list);
  553.             error(erroroutput,"the color is set to %d\n",temp2);    
  554.             (*l)++;
  555.             if (temp2 == 0)
  556.                 retchp->color[0] = '\0';
  557.             else
  558.                 sprintf(retchp->color,"#%.2x%.2x%.2x",colorlookupr[temp2],colorlookupg[temp2],colorlookupb[temp2]);
  559.             error(erroroutput,"the color is set to %s\n",retchp->color);    
  560.             break;
  561.         case 0x2403:
  562.             retpap->justify = dgetc(in,list);
  563.             error(erroroutput,"para just is %d\n",retpap->justify);
  564.             (*l)++;
  565.             break;
  566.         case 0x0868:
  567.         case 0x2406:
  568.             dgetc(in,list);
  569.             (*l)++;
  570.             break;
  571.         case 0x2A3E:
  572.             retchp->underline = dgetc(in,list);
  573.             error(erroroutput,"underline set to %d\n",retchp->underline);
  574.             (*l)++;
  575.             break;
  576.         case 0x2A48:
  577.             retchp->supersubscript = dgetc(in,list);
  578.             error(erroroutput,"sub super is %d\n",retchp->supersubscript);
  579.             (*l)++;
  580.             break;
  581.         case 0x740A:
  582.             retpap->ourtap.tlp.itl = dread_16ubit(in,list);
  583.             temp = dread_16ubit(in,list);
  584.             if (temp & 0x0002)
  585.                 retpap->ourtap.tlp.fShading=1;
  586.             if (temp & 0x0008)
  587.                 retpap->ourtap.tlp.fColor=1;
  588.             if (temp & 0x0020)
  589.                 retpap->ourtap.tlp.fHdrRows=1;
  590.             if (temp & 0x0040)
  591.                 retpap->ourtap.tlp.fLastRow=1;
  592.             if (temp & 0x0080)
  593.                 retpap->ourtap.tlp.fHdrCols=1;
  594.             if (temp & 0x0100)
  595.                 retpap->ourtap.tlp.fLastCol=1;
  596.             (*l)+=4;
  597.             break;
  598.         case 0xD605:
  599.             /*
  600.             retpap->fInTable = 1;
  601.             */
  602.             len = dgetc(in,list);
  603.             (*l)++;
  604.             error(erroroutput,"FIntable set to %d indirectly\n",retpap->fInTable);
  605.             for(i=0;i<len;i++)
  606.                 {
  607.                 dgetc(in,list);
  608.                 (*l)++;
  609.                 }
  610.             break;
  611.         case 0xD609:
  612.         /*the specs look wrong here, im winging it again :-)*/
  613.             len = dgetc(in,list);
  614.             retpap->ourtap.shade_no = len;
  615.             (*l)++;
  616.             error(erroroutput,"no of shaded things is %d\n",retpap->ourtap.shade_no);
  617.             for (i=0;i<retpap->ourtap.shade_no/2;i++)
  618.                 {
  619.                 temp2 = dread_16ubit(in,list);
  620.                 error(erroroutput,"temp2 is %x\n",temp2);
  621.                 retpap->ourtap.cell_fronts[i] = temp2 & 0x001F;
  622.                 /*this is disabled until table looks are supported
  623.                 */
  624.                 retpap->ourtap.cell_backs[i] = (temp2 & 0x03E0)>>5;
  625.                 
  626.                 retpap->ourtap.cell_pattern[i] = (temp2 & 0xFC00)>>10;
  627.                 error(erroroutput,"front color is %d\n",(temp2 & 0x001F));
  628.                 error(erroroutput,"back color is %d\n",((temp2 & 0x03E0))>>5);
  629.                 error(erroroutput,"shade pattern is %d\n",((temp2 & 0xFC00))>>10);
  630.                 (*l)+=2;
  631.                 }
  632.             break;
  633.         case 0x7627:
  634.             /*not tested, might be wrong, specs are a little ambigious*/
  635.             temp4 = dgetc(in,list);
  636.             temp3 = dgetc(in,list);
  637.             temp2 = dread_16ubit(in,list);
  638.             (*l)+=4;
  639.             for (i=temp4;i<temp3;i++)
  640.                 {
  641.                 retpap->ourtap.cell_fronts[i] = temp2 & 0x001F;
  642.                 retpap->ourtap.cell_backs[i] = (temp2 & 0x03E0)>>5;
  643.                 retpap->ourtap.cell_pattern[i] = (temp2 & 0xFC00)>>10;
  644.                 }
  645.             error(erroroutput,"1: UNTESTED SHADE SUPPORT !!!!\n");
  646.             break;
  647.         case 0x7628:
  648.             /*not tested, might be wrong, specs are a little ambigious*/
  649.             temp4 = dgetc(in,list);
  650.             temp3 = dgetc(in,list);
  651.             temp2 = dread_16ubit(in,list);
  652.             (*l)+=4;
  653.             for (i=temp4;i<temp3;i++)
  654.                 {
  655.                 if (isodd(i))
  656.                     {
  657.                     retpap->ourtap.cell_fronts[i] = temp2 & 0x001F;
  658.                     retpap->ourtap.cell_backs[i] = (temp2 & 0x03E0)>>5;
  659.                     retpap->ourtap.cell_pattern[i] = (temp2 & 0xFC00)>>10;
  660.                     }
  661.                 }
  662.             error(erroroutput,"2: UNTESTED SHADE SUPPORT !!!!\n");
  663.             break;
  664.         case 0xD608:
  665.             /*
  666.             retpap->fInTable = 1;
  667.             */
  668.             len = dread_16ubit(in,list);
  669.             (*l)+=2;
  670.             error(erroroutput,"FIntable set to %d indirectly, val %x\n",retpap->fInTable,len);
  671.             retpap->ourtap.cell_no = dgetc(in,list);
  672.             (*l)++;
  673.             error(erroroutput,"there are %d cells in this row\n",retpap->ourtap.cell_no);
  674.             retpap->ourtap.tablewidth=0;
  675.             for(i=0;i<retpap->ourtap.cell_no+1;i++)
  676.                 {
  677.                 retpap->ourtap.cellwidth[i] = (S16) dread_16ubit(in,list);
  678.                 error(erroroutput,"a dx is %d\n",retpap->ourtap.cellwidth[i]);
  679.                 (*l)+=2;
  680.                 }
  681.             retpap->ourtap.tablewidth=retpap->ourtap.cellwidth[retpap->ourtap.cell_no] - retpap->ourtap.cellwidth[0];
  682.             for(i=0;i<len-2-((retpap->ourtap.cell_no+1)*2);i++)
  683.                 {
  684.                 dgetc(in,list);
  685.                 (*l)++;
  686.                 }
  687.             break;
  688.         case 0x6A09:
  689.             retchp->fontcode=dread_16ubit(in,list);
  690.             error(erroroutput,"font code is %d\n", retchp->fontcode);
  691.             retchp->fontspec=dread_16ubit(in,list);
  692.             error(erroroutput,"char spec is %d\n",retchp->fontspec);
  693.             retchp->fSpec=1;
  694.             (*l)+=4;
  695.             break;
  696.         case 0x080A:
  697.             retchp->fOle2=dgetc(in,list);
  698.             error(erroroutput,"is an ole2 %d\n",retchp->fOle2);
  699.             (*l)++;
  700.             break;
  701.             break;
  702.         case 0x0856:
  703.             retchp->fObj=dgetc(in,list);
  704.             error(erroroutput,"is an object is %d\n",retchp->fObj);
  705.             (*l)++;
  706.             break;
  707.         case 0x0854:
  708.             dgetc(in,list);
  709.             (*l)++;
  710.             break;
  711.         case 0x0855:
  712.             retchp->fSpec=dgetc(in,list);
  713.             error(erroroutput,"fSpec, special set to %d\n",retchp->fSpec);
  714.             (*l)++;
  715.             break;
  716.         case 0x8840:
  717.             /*i think these all are lumped together and take two bytes*/
  718.             dread_16ubit(in,list);
  719.             (*l)+=2;
  720.             break;
  721.         case 0x6A03:
  722.             retchp->fSpec=1;
  723.             retchp->fcPic = dread_32ubit(in,list);
  724.             error(erroroutput,"fcpic is %x, fSpec\n", retchp->fcPic);
  725.             /*
  726.             get_blips(U32 fcDggInfo,U32 lcbDggInfo,FILE *tablefd,FILE *mainfd,int *noofblips,int dontdopre);
  727.             */
  728.             (*l)+=4;
  729.             break;
  730.         case 0x6412:
  731.             dread_16ubit(in,list);
  732.             dread_16ubit(in,list);
  733.             (*l)+=4;
  734.             break;
  735.         default:
  736.             {
  737.             error(erroroutput,"unsupported %x l is %d",clist,*l);
  738.             clist = (clist & 0xe000);
  739.             error(erroroutput,"val %d",clist);
  740.             clist = clist >> 13;
  741.             error(erroroutput,"val %d",clist);
  742.             len=0;
  743.             switch (clist)
  744.                 {
  745.                 case 0:
  746.                 case 1:
  747.                     len=1;
  748.                     break;
  749.                 case 2:
  750.                 case 4:
  751.                 case 5: 
  752.                     len=2;
  753.                     break;
  754.                 case 7:
  755.                     len=3;
  756.                     break;
  757.                 case 3:
  758.                     len=4;
  759.                     break;
  760.                 case 6:
  761.                     len=dgetc(in,list);
  762.                     (*l)++;
  763.                     break;
  764.                 default:
  765.                     error(erroroutput,"shouldnt see this len value!!\n");
  766.                     break;
  767.                 }
  768.             
  769.             for(i=0;i<len;i++)
  770.                 {
  771.                 dgetc(in,list);
  772.                 (*l)++;
  773.                 }
  774.             error(erroroutput,"l is now %d\n",*l);
  775.             }
  776.         
  777.         }
  778.     }
  779.